#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
    int gdriver = DETECT, gmode, errorcode;
    int xmax, ymax;
    char buf[100];
    initgraph(&gdriver, &gmode,"F:\\google_code\\trunk\\Win-TC");
    errorcode = graphresult();
    if (errorcode != grOk)
    {
       printf("Graphics error: %s",grapherrormsg(errorcode));
        printf("Press any key to halt:");
        getch();
        exit(1);
    }
    setcolor(getmaxcolor());

   /* xmax =getmaxx()/2;
    ymax =getmaxy()/2;        */
    moveto(420,420);

    sprintf(buf,"x %d  y %d",getmaxx(),getmaxy());
    outtext(buf);
    line(420, 420, 300, 420);
    line(420, 420, 420, 300);
    line(420, 300, 300, 300);
    line(300, 420, 300, 300);
    getch();
    closegraph();
    return 0;}
